package PTA_JAVA.JavaB.Javademo22;

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s;
        Set<String> list = new HashSet<>();
        while(!"!!!!!".equals(s=sc.next().toLowerCase())){
            list.add(s);
        }
        System.out.println(list.size());
    }
}
